package com.sys.tdhclient.prop;

import org.apache.log4j.PropertyConfigurator;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

/**
 * 加载配置文件
 */
public class FileProps {
    public static String confFilePath = null;
    public  Properties initProperties() throws Exception{
  confFilePath = System.getProperty("user.dir") + File.separator + "conf" + File.separator;
        File confFile = new File( confFilePath + "conf.properties");
        Properties confProps=null;
        if(confFile.exists()) {
            confProps = new Properties();
            confProps.load(new FileInputStream( confFilePath +"conf.properties"));
            confProps.load(new FileInputStream( confFilePath +"log4j.properties"));
            PropertyConfigurator.configure(confProps);
        }
        return  confProps;
    }

}
